@use 'sass:map';
@use 'sass:color';
@use '@angular/material' as mat;

@mixin color($theme) {
  $config: mat.get-color-config($theme);

  $primary-palette: map.get($config, 'primary');
  $accent-palette: map.get($config, 'accent');
  $background: map.get($config, background);
  $foreground: map.get($config, foreground);

  .pac-cube__join-menu.mat-mdc-menu-panel {
    width: 500px;
    max-width: 500px;

    .table-join {
      display: flex;
      justify-content: center;
      align-items: center;
      flex: 1;
      padding: 1rem;
      cursor: pointer;

      &:hover {
        background-color: opacify(mat.get-color-from-palette($primary-palette, 100), 0.8);
      }

      &.selected {
        background-color: opacify(mat.get-color-from-palette($primary-palette, 300), 0.8);
      }
    }

    .join-fields-form {
      margin-top: 1rem;
    }
  }

  .pac-model-cube-structure {
    .pac-cube__join-table-container {
      .join-table {
        background-color: rgba(80, 127, 242, 0.08);

        &::before {
          background-color: mat.get-color-from-palette($primary-palette, 300);
        }
      }
    }
  }
}

@mixin typography($theme) {
}

@mixin density($theme) {
}

@mixin theme($theme) {
  $color: mat.get-color-config($theme);
  $density: mat.get-density-config($theme);
  $typography: mat.get-typography-config($theme);

  @if $color != null {
    @include color($color);
  }
  @if $density != null {
    @include density($density);
  }
  @if $typography != null {
    @include typography($typography);
  }
}
